/**
 * 用于将电机和dog的主体代码分离
 * 便于其他电机移植
 */
#ifndef MOTOR_CONTROL_H
#define MOTOR_CONTROL_H

#include <stdint.h>

typedef struct
{
    float kp;
    float kd;
    float torque;
    float velocity;
    float position;
} MotorParam_t;

extern MotorParam_t param;

void motor_control_init(void);
void motor_control_run(void);
void motor_set_param(uint8_t id, MotorParam_t *param);
void motor_set_kp(uint8_t id, float kp);
void motor_set_kd(uint8_t id, float kd);
void motor_set_torque(uint8_t id, float torque);
void motor_set_velocity(uint8_t id, float velocity);
void motor_set_position(uint8_t id, float position);
float motor_get_position(uint8_t id);
float motor_get_velocity(uint8_t id);
float motor_get_torque(uint8_t id);

#endif
